package com.zhixing.map.client;

import com.zhixing.common.annotation.Passenger;
import com.zhixing.common.domain.dto.LocationDTO;
import com.zhixing.common.domain.dto.RoutePlanningDTO;
import com.zhixing.common.domain.vo.DriverDistanceVO;
import com.zhixing.common.domain.vo.RoutePlanningVO;
import com.zhixing.common.utils.Res;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@FeignClient("map-service")
public interface MapClient {

    /**
     * 路线规划
     * @param routePlanningDTO 位置信息
     * @return 路线规划信息
     */
    @GetMapping("/map/routePlanning")
    Res<RoutePlanningVO> routePlanning(@Validated @SpringQueryMap RoutePlanningDTO routePlanningDTO);

    /**
     * 获取订单附近司机
     * @param locationDTO 位置信息
     * @return List<DriverDistanceVO> 司机位置列表
     */
    @Passenger
    @GetMapping("/location/nearbyDrivers")
    Res<List<DriverDistanceVO>> getOrderNearbyDrivers(@Validated @SpringQueryMap LocationDTO locationDTO);
}
